Embodiments are in the field of computer programs, and particularly in the field of compilers for seamlessly reducing the image size of firmware components.
The development and incorporation of extensive and complicated firmware programs in present computer platforms has led to increases in storage size requirements. Typically, firmware, such as BIOS (basic input/output system) code, diagnostic routines, embedded applications, and the like are stored in relatively expensive memory devices, such as Flash memory. Space in Flash devices, and other similar memory devices is typically at a premium because such memory is usually used in energy and/or space critical applications in which much code is stored in a relatively small amount of memory. With the constant downward pressure in the price of computer and embedded system platforms, it is important to reduce the costs associated with the construction of platforms. Reducing the firmware footprint helps to reduce the bill-of-materials cost associated with FLASH and other memory parts, which are critical components of the platform.
In order to optimize the memory usage, reducing the size of the binary (object code) of the firmware is critical. Various methods exist to reduce the size of program code, such as compression, and similar techniques. Compression methods typically take advantage of identical lines of code, and represent these portions of code in a different, and usually smaller, format. This method requires the addition of separate compression and decompression algorithms to encode the original program into a smaller format, and then decode the compressed program for proper execution. Compression methods can thus add significant processing overhead to the firmware build and execution stages. In general, compression is best suited to lengthy programs written in a high-level language. It is not particularly well-suited to all low-level, hardware specific code such as firmware. For example, certain types of code, such as execute-in-place (XIP) code cannot be compressed due to structural inherencies in the code. Such code is typically used for sensitive applications, such as firmware or embedded applications. Compression is also generally not effective in program code where entire modules or subroutines are used in a plurality of different places, or where redundant modules or lines of code are separated from each other by a relatively great distance in the program.